import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from "vuex-persistedstate";
console.log("===============")

console.log(createPersistedState)
Vue.use(Vuex)

const store = () => new Vuex.Store({
  state: {
    textData: "0",
  },
  mutations: {
    textData(state,val){
      state.textData = val
    }
  },
  actions: {
  },
  modules: {
  },
  plugins: [createPersistedState({
    storage: window.sessionStorage,
    reducer(val) {
      return {
        textData: val.textData
      }
    }
  })]
})
export default store